fix(import): restore TablePlus password and SSH key import#1388
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes to "Import from Other App", all surfaced when importing from TablePlus:
TablePlus passwords import again. A regression that shipped in 0.43.0 changed the keychain service TablePro queries from
com.tableplus.TablePlustocom.tinyapp.TablePlus(TablePlus's bundle id). TablePlus stores secrets undercom.tableplus.TablePlus, so every lookup returnederrSecItemNotFound: no keychain prompt, blank passwords, and no warning banner. Verified against a live keychain (security find-generic-password -s com.tableplus.TablePlus -a "{UUID}_database"exists; thetinyappservice has zero items). The correct service is restored and kept as a named constant next toappBundleIdentifierso the two are visibly distinct.No more fake SSH key paths or empty TLS paths. When no key is selected, TablePlus stores the literal placeholder
Import a private key...inServerPrivateKeyNamewhile leavingisUsePrivateKeytrue. The importer turned that into~/.ssh/Import a private key.... Now a private key path is kept only if it resolves to a file that exists on disk, which works for any placeholder wording, not just the current English string. Empty TLS certificate paths now import as none instead of blank strings.No misleading keychain prompt for DBeaver. The "macOS will ask for your login password" alert fired for every importer, including DBeaver, which reads passwords from its own file and never touches the keychain. A new
readsPasswordsFromKeychainflag on the importer protocol gates the alert, so it only shows for keychain-based importers (TablePlus, Sequel Ace, DataGrip).Root cause
The keychain bug came from commit b08186c, which "aligned" the keychain service to the bundle id. TablePlus uses two different reverse-DNS identifiers on purpose: bundle id and Application Support folder are
com.tinyapp.TablePlus(legacy domain), but the keychain service iscom.tableplus.TablePlus(newer domain). The SSH and TLS bugs are the same family: TablePlus persists placeholder or empty sentinel values, and the importer assumed every stored value was real.Tests
com.tableplus.TablePlus, accounts{id}_database/_server/_server_key) and verify the password reaches the import envelope. They would have caught b08186c.readsPasswordsFromKeychainvalue is asserted.Out of scope (pre-existing, not touched)
These look like they belong to the DataGrip import PR (#1374):
count == 4, but there are 5 importers now (DataGrip).CockroachDBmaps toCockroachDBin source but the test expectsPostgreSQL.swiftlint --strictnumber-separator and import-sort violations in the TablePlus test file.Verification
swiftlint lint --strictclean on changed files (no new violations introduced).